Data Loading and Cleaning

  User_ID       App Daily_Minutes_Spent Posts_Per_Day Likes_Per_Day
1     U_1 Pinterest                 288            16            94
2     U_2  Facebook                 192            14           117
3     U_3 Instagram                 351            13           120
4     U_4    TikTok                  21            20           117
5     U_5  LinkedIn                 241            16             9
6     U_6   Twitter                 464             3           137
  Follows_Per_Day Engagement
1               0        110
2              15        146
3              48        181
4               8        145
5              21         46
6              30        170

Introduction

Column {.tabset .tabset-fade}

Motivation and Background

This dashboard provides an analysis of social media usage metrics, exploring how users engage with different platforms. The dataset includes daily time spent, posts, likes, and follows across various platforms, allowing for an in-depth analysis of engagement patterns and usage trends.

Some research questions include:

  • Which platform has the highest average daily usage?
  • What is the relationship between likes and follows?
  • How do different metrics correlate with each other?

Research Questions

We will investigate the following research questions:

  • Average daily usage per platform: Identify which platforms have higher average engagement.
  • Likes vs. Follows Relationship: Determine the correlation between likes and follows.
  • Correlation of metrics: Analyze correlations between engagement metrics across platforms.

Summary Statistics

Column {.tabset .tabset-fade}

Distribution of Daily Minutes Spent

Average Daily Usage by Platform

Correlation

Correlation Matrix

Exploration

Engagement Across Platforms

Likes vs Follows

Conclusion

Summary and Further Work

The analysis shows patterns in social media usage across platforms. For example, platforms with higher average daily minutes indicate higher user engagement. Further work could include:

  • Detailed time series analysis: Studying how engagement changes over time.
  • User segmentation analysis: Analyzing engagement by user demographics.
  • External factors: Incorporating other datasets to enhance insights.

References

---
title: "Social Media Usage Analysis"
author: "Scot Swanson"
output:
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    theme:
      bootswatch: zephyr
    source_code: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(plotly)
library(DT)
library(ggplot2)
```

# Data Loading and Cleaning

```{r}
# Load the social media dataset
data <- read.csv("social_media_usage.csv")

# Data Cleaning: Remove any missing values
data <- na.omit(data)

# Feature Engineering: Calculate Engagement as a combination of Posts, Likes, and Follows
data <- data %>%
  mutate(Engagement = Posts_Per_Day + Likes_Per_Day + Follows_Per_Day)

# Display the first few rows of the cleaned data
head(data)
```

# Introduction

Column {.tabset .tabset-fade}

### Motivation and Background

This dashboard provides an analysis of social media usage metrics, exploring how users engage with different platforms. The dataset includes daily time spent, posts, likes, and follows across various platforms, allowing for an in-depth analysis of engagement patterns and usage trends.

Some research questions include:

- Which platform has the highest average daily usage?
- What is the relationship between likes and follows?
- How do different metrics correlate with each other?

### Research Questions

We will investigate the following research questions:

- **Average daily usage per platform**: Identify which platforms have higher average engagement.
- **Likes vs. Follows Relationship**: Determine the correlation between likes and follows.
- **Correlation of metrics**: Analyze correlations between engagement metrics across platforms.

# Summary Statistics

Column {.tabset .tabset-fade}

### Distribution of Daily Minutes Spent

```{r}
ggplot(data, aes(x=Daily_Minutes_Spent)) +
  geom_histogram(bins=20, fill="#1f77b4") +
  labs(title="Distribution of Daily Minutes Spent",
       x="Daily Minutes Spent", y="Frequency") +
  theme_minimal()
```

### Average Daily Usage by Platform

```{r}
avg_usage <- data %>%
  group_by(App) %>%
  summarize(avg_daily_minutes = mean(Daily_Minutes_Spent)) %>%
  arrange(desc(avg_daily_minutes))

ggplot(avg_usage, aes(x=reorder(App, -avg_daily_minutes), y=avg_daily_minutes)) +
  geom_bar(stat="identity", fill="#2ca02c") +
  labs(title="Average Daily Minutes Spent by Platform",
       x="Platform", y="Average Daily Minutes") +
  theme_minimal()
```

# Correlation

### Correlation Matrix

```{r}
correlation_matrix <- cor(data %>% select(Daily_Minutes_Spent, Posts_Per_Day, Likes_Per_Day, Follows_Per_Day, Engagement))
plot_ly(
  z = ~correlation_matrix,
  x = colnames(correlation_matrix),
  y = rownames(correlation_matrix),
  type = "heatmap",
  colorscale = "Viridis"
) %>%
  layout(title = "Correlation Matrix for Social Media Usage Metrics")
```

# Exploration

### Engagement Across Platforms

```{r}
fig <- plot_ly(data, x = ~App, y = ~Engagement, type = "scatter", mode = "markers",
               marker = list(size = ~Daily_Minutes_Spent, color = ~App)) %>%
  layout(title = "Engagement across Social Media Platforms",
         xaxis = list(title = "Platform"),
         yaxis = list(title = "Engagement"))
fig
```

### Likes vs Follows

```{r}
ggplot(data, aes(x=Likes_Per_Day, y=Follows_Per_Day, color=App)) +
  geom_point(size=3, alpha=0.6) +
  labs(title="Relationship Between Likes and Follows",
       x="Likes Per Day", y="Follows Per Day") +
  theme_minimal()
```

# Conclusion

### Summary and Further Work

The analysis shows patterns in social media usage across platforms. For example, platforms with higher average daily minutes indicate higher user engagement. Further work could include:

- **Detailed time series analysis**: Studying how engagement changes over time.
- **User segmentation analysis**: Analyzing engagement by user demographics.
- **External factors**: Incorporating other datasets to enhance insights.

# References

- [Statista: Social Media Usage](https://www.statista.com/topics/1164/social-networks/)
- [Buffer Library: Social Media Engagement](https://buffer.com/library/social-media-engagement/)